/**
 * 
 */
package com.googlecode.pcapj.bridj;

import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Field;

/**
	typedef struct u_int32_t
	{
		u_char byte1;
		u_char byte2;
		u_char byte3;
		u_char byte4;
	}ip_address; 
 */
public class u_int32_t extends StructObject {
    public u_int32_t() { super(); }
    public u_int32_t(Pointer<? extends StructObject> pointer) { super(pointer); }
    public u_int32_t(u_int32_t u_int32_t) { this(Pointer.pointerTo(u_int32_t)); }
    
    @Field(0)
    public byte byte1() {
            return this.io.getByteField(this, 0);
    }
    @Field(0) 
    public u_int32_t byte1(byte byte1) {
            this.io.setByteField(this, 0, byte1);
            return this;
    }
    
    @Field(1)
    public byte byte2() {
            return this.io.getByteField(this, 1);
    }
    @Field(1) 
    public u_int32_t byte2(byte byte2) {
            this.io.setByteField(this, 1, byte2);
            return this;
    }
    
    @Field(2)
    public byte byte3() {
            return this.io.getByteField(this, 2);
    }
    @Field(2) 
    public u_int32_t byte3(byte byte3) {
            this.io.setByteField(this, 2, byte3);
            return this;
    }
    
    @Field(3)
    public byte byte4() {
            return this.io.getByteField(this, 3);
    }
    @Field(3) 
    public u_int32_t byte4(byte byte4) {
            this.io.setByteField(this, 3, byte4);
            return this;
    }
    public byte[] getBytes(){
    	return new byte[]{
    		byte1(),byte2(),byte3(),byte4()
    	};
    }
}
